from fastapi import FastAPI

from app.core.config import settings
from app.core.init import init_app
from app.core.lifespan import lifespan

# 1.实例化FastAPI
app = FastAPI(
    lifespan=lifespan,
    title=settings.PROJECT_NAME,
    debug=settings.DEBUG,
    contact={
        "name": "yangzhide",
        "email": "xxzjyzd@126.com"
    }
)

# 2.初始化app配置
init_app(app)


if __name__ == "__main__":
    import uvicorn
    uvicorn.run("main:app", host="127.0.0.1", port=9001)